/**
 * @Author: 焦质晔
 * @Date: 2019/6/20
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2019-10-10 13:44:09
 */
'use strict';

const path = require('path');
module.exports = {
  dev: {
    // Paths
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',

    // http proxy
    proxyTable: {
      // '/api/sysManage': {
      //   target: 'http://172.18.195.215:7883',
      //   changeOrigin: true,
      //   pathRewrite: {
      //   '^/api/sysManage': ''
      //   }
      // },
      // '/api/cmscloud.wholesales': { 连本地的话，把对应路由配置到/api 的上面
      //
      //   target: 'http://172.16.3.197:7899', 这里改成你自己的ip端口
      //   changeOrigin: true,
      //   pathRewrite: {
      //   '^/api/cmscloud.wholesales': ''
      //   }
      //   },

      // '/api/sysManage/dealerCompany': {
      //   target: 'http://localhost:7883/',
      //   changeOrigin: true,
      //   pathRewrite: {
      //     '^/api/sysManage/dealerCompany': 'dealerCompany'
      //   }
      // },

      '/api/sysManage': {
        target: 'http://localhost:8807/',
        changeOrigin: true,
        pathRewrite: {
          '^/api/sysManage': ''
        }
      },

      //  '/api/cmscloud.wms': {
      //    target: 'http://localhost:9090', // dev gateway 外网地址
      //    changeOrigin: true,
      //    pathRewrite: {
      //      '^/api/cmscloud.wms': ''
      //    }
      //  },
      // '/api': {
      //   target: 'http://dcs-dev-api.cf3fa6888f70448cabf3acb225fff6a8b.cn-hangzhou.alicontainer.com', // dev gateway 外网地址
      //    changeOrigin: true,
      //    pathRewrite: {
      //     '^/api': '/api'
      //   }
      //   },
      // '/api/sysManage': {
      //   target: 'http://localhost:7883',
      //   changeOrigin: true,
      //   pathRewrite: {
      //   '^/api/sysManage': ''
      //   }
      // },

      '/api/cms_claimfac': {
        target: 'http://localhost:4907/',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms_claimfac': ''
        }
      },

      '/api/cmscloud.epc': {
        target: 'http://localhost:8808', // dev gateway 外网地址
        changeOrigin: true,
        pathRewrite: {
          '^/api/cmscloud.epc': ''
        }
      },

      '/api': {
        //  target: 'http://210.13.111.26:10436', // dev gateway 外网地址
        target: 'https://dcs-test-api.radar-ev.com', // dev gateway 外网地址
        changeOrigin: true,
        pathRewrite: {
          '^/api': '/api'
        }
      },
      '/ttFiRebate': {
        target: 'http://172.16.3.197:7899',
        changeOrigin: true,
        pathRewrite: {
          '^/ttFiRebate': '/ttFiRebate'
        }
      },
      '/rebateSubprojects': {
        target: 'http://172.16.3.197:7899',
        changeOrigin: true,
        pathRewrite: {
          '^/rebateSubprojects': '/rebateSubprojects'
        }
      },
      '/contract': {
        // target: 'http://kfcyx.yycsy.com',
        target: 'http://172.16.101.219:7901',
        changeOrigin: true,
        pathRewrite: {
          '^/contract': '/contract'
        }
      },
      '/major': {
        // target: 'http://kfcyx.yycsy.com',
        target: 'http://172.16.101.219:7901',
        changeOrigin: true,
        pathRewrite: {
          '^/major': '/major'
        }
      },
      '/vehicleProduct': {
        // target: 'http://kfcyx.yycsy.com',
        target: 'http://10.112.0.38:7891',
        changeOrigin: true,
        pathRewrite: {
          '^/vehicleProduct': '/vehicleProduct'
        }
      },
      '/tmBusinessPara': {
        // target: 'http://kfcyx.yycsy.com',
        target: 'http://172.16.101.16:7894',
        changeOrigin: true,
        pathRewrite: {
          '^/tmBusinessPara': '/tmBusinessPara'
        }
      },

      '/ttVsDeliveryOrder': {
        // target: 'http://kfcyx.yycsy.com',
        target: 'http://172.16.101.201:7899',
        changeOrigin: true,
        pathRewrite: {
          '^/ttVsDeliveryOrder': '/ttVsDeliveryOrder'
        }
      },
      '/tmVsWarehouse': {
        // target: 'http://kfcyx.yycsy.com',
        target: 'http://172.16.101.201:7899',
        changeOrigin: true,
        pathRewrite: {
          '^/tmVsWarehouse': '/tmVsWarehouse'
        }
      },
      '/tmFiAccountType': {
        // target: 'http://kfcyx.yycsy.com',
        target: 'http://172.16.101.201:7899',
        changeOrigin: true,
        pathRewrite: {
          '^/tmFiAccountType': '/tmFiAccountType'
        }
      },
      '/tmFiOrderTypeSub': {
        // target: 'http://kfcyx.yycsy.com',
        target: 'http://172.16.101.201:7899',
        changeOrigin: true,
        pathRewrite: {
          '^/tmFiOrderTypeSub': '/tmFiOrderTypeSub'
        }
      },
      '/ttFiAccount': {
        // target: 'http://kfcyx.yycsy.com',
        target: 'http://172.16.101.201:7899',
        changeOrigin: true,
        pathRewrite: {
          '^/ttFiAccount': '/ttFiAccount'
        }
      },

      '/vsProduct': {
        // target: 'http://kfcyx.yycsy.com',
        target: 'http://172.16.101.219:7899',
        changeOrigin: true,
        pathRewrite: {
          '^/vsProduct': '/vsProduct'
        }
      },
      '/dealerAddress': {
        // target: 'http://kfcyx.yycsy.com',
        target: 'http://172.16.3.96:7899',
        changeOrigin: true,
        pathRewrite: {
          '^/dealerAddress': '/dealerAddress'
        }
      },
      '/fiOrderTypeSub': {
        target: 'http://172.16.3.96:7899',
        changeOrigin: true,
        pathRewrite: {
          '^/fiOrderTypeSub': '/fiOrderTypeSub'
        }
      },
      '/orderGoods': {
        target: 'http://172.16.3.96:7899',
        changeOrigin: true,
        pathRewrite: {
          '^/orderGoods': '/orderGoods'
        }
      },
      '/code': {
        target: 'http://172.16.101.219:7891',
        changeOrigin: true,
        pathRewrite: {
          '^/code': '/code'
        }
      },
      '/productGroup': {
        target: 'http://172.16.101.219:7891',
        changeOrigin: true,
        pathRewrite: {
          '^/productGroup': '/productGroup'
        }
      },
      '/ttVsCertificatePost': {
        target: 'http://172.16.101.46:7894',
        changeOrigin: true,
        pathRewrite: {
          '^/ttVsCertificatePost': '/ttVsCertificatePost'
        }
      }
    },

    // Various Dev Server settings
    // host: '172.16.2.206',
    host: 'localhost',
    port: 8080,
    autoOpenBrowser: true,

    // Source Maps
    devtool: 'cheap-source-map',
    cssSourceMap: true
  },

  build: {
    // Template for index.html
    index: path.resolve(__dirname, '../dist/index.html'),

    // Paths
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',

    // Source Maps
    productionSourceMap: false,
    devtool: 'source-map',

    // Gzip
    productionGzip: false,
    productionGzipExtensions: ['js', 'css']
  }
};
